"use client"

import { Listbox, ListboxItem } from "@nextui-org/react";
import { useRouter } from "next/navigation";
import React from "react";

export const ListboxWrapper = ({ data }: { data: any }) => {
  const router = useRouter()

  return (
    <div className="w-[29%] border-small px-1 py-2 rounded-small border-default-200 dark:border-default-100">
      <Listbox aria-label="faded" onAction={(k) => router.push(`/cate/${k}`)}>
        {
          data?.map((item: any) => <ListboxItem key={item.id}>{item.title}</ListboxItem>)
        }
      </Listbox>
    </div>
  );
}